/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hello;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

/**
 * @author Администратор
 */
public class HelloMIDlet extends MIDlet implements CommandListener, ItemCommandListener {

    private boolean midletPaused = false;
    private Display display;
    private List menu;
    private int money = 0;

    final  Alert soundAlert = new Alert("Millioner");

    //<editor-fold defaultstate="collapsed" desc=" Generated Fields ">//GEN-BEGIN:|fields|0|
    private Command exitCommand;
    private Command okCommand;
    private Command okCommand1;
    private Command exitCommand1;
    private Command stopCommand;
    private Command cancelCommand;
    private Command helpCommand;
    private Form form;
    private StringItem stringItem;
    private ChoiceGroup choiceGroup;
    private ImageItem imageItem;
    private StringItem stringItem3;
    private StringItem stringItem1;
    private StringItem stringItem2;
    private Form form1;
    private ChoiceGroup choiceGroup1;
    private ChoiceGroup choiceGroup2;
    private ChoiceGroup choiceGroup3;
    private ChoiceGroup choiceGroup4;
    private ChoiceGroup choiceGroup5;
    private ChoiceGroup choiceGroup6;
    private ChoiceGroup choiceGroup7;
    private ChoiceGroup choiceGroup9;
    private ChoiceGroup choiceGroup8;
    private ChoiceGroup choiceGroup10;
    private ChoiceGroup choiceGroup12;
    private ChoiceGroup choiceGroup11;
    private ChoiceGroup choiceGroup14;
    private ChoiceGroup choiceGroup13;
    private ChoiceGroup choiceGroup15;
    private Form form2;
    private StringItem stringItem4;
    private Image image1;
    //</editor-fold>//GEN-END:|fields|0|

    /**
     * The HelloMIDlet constructor.
     */
    public HelloMIDlet() {
    }

    //<editor-fold defaultstate="collapsed" desc=" Generated Methods ">//GEN-BEGIN:|methods|0|
    //</editor-fold>//GEN-END:|methods|0|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">//GEN-BEGIN:|0-initialize|0|0-preInitialize
    /**
     * Initilizes the application.
     * It is called only once when the MIDlet is started. The method is called before the <code>startMIDlet</code> method.
     */
    private void initialize() {//GEN-END:|0-initialize|0|0-preInitialize
        // write pre-initialize user code here
//GEN-LINE:|0-initialize|1|0-postInitialize
        // write post-initialize user code here
    }//GEN-BEGIN:|0-initialize|2|
    //</editor-fold>//GEN-END:|0-initialize|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">//GEN-BEGIN:|3-startMIDlet|0|3-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Started point.
     */
    public void startMIDlet() {//GEN-END:|3-startMIDlet|0|3-preAction
        // write pre-action user code here
        switchDisplayable(null, getForm());//GEN-LINE:|3-startMIDlet|1|3-postAction
        // write post-action user code here
    }//GEN-BEGIN:|3-startMIDlet|2|
    //</editor-fold>//GEN-END:|3-startMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">//GEN-BEGIN:|4-resumeMIDlet|0|4-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Resumed point.
     */
    public void resumeMIDlet() {//GEN-END:|4-resumeMIDlet|0|4-preAction
        // write pre-action user code here
//GEN-LINE:|4-resumeMIDlet|1|4-postAction
        // write post-action user code here
    }//GEN-BEGIN:|4-resumeMIDlet|2|
    //</editor-fold>//GEN-END:|4-resumeMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">//GEN-BEGIN:|5-switchDisplayable|0|5-preSwitch
    /**
     * Switches a current displayable in a display. The <code>display</code> instance is taken from <code>getDisplay</code> method. This method is used by all actions in the design for switching displayable.
     * @param alert the Alert which is temporarily set to the display; if <code>null</code>, then <code>nextDisplayable</code> is set immediately
     * @param nextDisplayable the Displayable to be set
     */
    public void switchDisplayable(Alert alert, Displayable nextDisplayable) {//GEN-END:|5-switchDisplayable|0|5-preSwitch
        // write pre-switch user code here
        Display display = getDisplay();//GEN-BEGIN:|5-switchDisplayable|1|5-postSwitch
        if (alert == null) {
            display.setCurrent(nextDisplayable);
        } else {
            display.setCurrent(alert, nextDisplayable);
        }//GEN-END:|5-switchDisplayable|1|5-postSwitch
        // write post-switch user code here
    }//GEN-BEGIN:|5-switchDisplayable|2|
    //</editor-fold>//GEN-END:|5-switchDisplayable|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">//GEN-BEGIN:|7-commandAction|0|7-preCommandAction
    /**
     * Called by a system to indicated that a command has been invoked on a particular displayable.
     * @param command the Command that was invoked
     * @param displayable the Displayable where the command was invoked
     */
    public void commandAction(Command command, Displayable displayable) {//GEN-END:|7-commandAction|0|7-preCommandAction
        // write pre-action user code here
        if (displayable == form) {//GEN-BEGIN:|7-commandAction|1|146-preAction
            if (command == exitCommand1) {//GEN-END:|7-commandAction|1|146-preAction
                // write pre-action user code here
//GEN-LINE:|7-commandAction|2|146-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|3|147-preAction
        } else if (displayable == form1) {
            if (command == exitCommand1) {//GEN-END:|7-commandAction|3|147-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm());//GEN-LINE:|7-commandAction|4|147-postAction
                // write post-action user code here
            } else if (command == okCommand1) {//GEN-LINE:|7-commandAction|5|129-preAction

//GEN-LINE:|7-commandAction|6|129-postAction

            }//GEN-BEGIN:|7-commandAction|7|149-preAction
        } else if (displayable == form2) {
            if (command == exitCommand1) {//GEN-END:|7-commandAction|7|149-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm());//GEN-LINE:|7-commandAction|8|149-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|9|7-postCommandAction
        }//GEN-END:|7-commandAction|9|7-postCommandAction
       // write post-action user code here
    }//GEN-BEGIN:|7-commandAction|10|
    //</editor-fold>//GEN-END:|7-commandAction|10|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: exitCommand ">//GEN-BEGIN:|18-getter|0|18-preInit
    /**
     * Returns an initiliazed instance of exitCommand component.
     * @return the initialized component instance
     */
    public Command getExitCommand() {
        if (exitCommand == null) {//GEN-END:|18-getter|0|18-preInit
            // write pre-init user code here
            exitCommand = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|18-getter|1|18-postInit
            // write post-init user code here
        }//GEN-BEGIN:|18-getter|2|
        return exitCommand;
    }
    //</editor-fold>//GEN-END:|18-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand ">//GEN-BEGIN:|26-getter|0|26-preInit
    /**
     * Returns an initiliazed instance of okCommand component.
     * @return the initialized component instance
     */
    public Command getOkCommand() {
        if (okCommand == null) {//GEN-END:|26-getter|0|26-preInit
            // write pre-init user code here
            okCommand = new Command("Ok", Command.OK, 0);//GEN-LINE:|26-getter|1|26-postInit
            // write post-init user code here
        }//GEN-BEGIN:|26-getter|2|
        return okCommand;
    }
    //</editor-fold>//GEN-END:|26-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: form1 ">//GEN-BEGIN:|28-getter|0|28-preInit
    /**
     * Returns an initiliazed instance of form1 component.
     * @return the initialized component instance
     */
    public Form getForm1() {
        if (form1 == null) {//GEN-END:|28-getter|0|28-preInit
            // write pre-init user code here
            form1 = new Form("form1", new Item[] { getChoiceGroup1(), getChoiceGroup2(), getChoiceGroup3(), getChoiceGroup4(), getChoiceGroup5(), getChoiceGroup6(), getChoiceGroup7(), getChoiceGroup8(), getChoiceGroup9(), getChoiceGroup10(), getChoiceGroup11(), getChoiceGroup12(), getChoiceGroup13(), getChoiceGroup14(), getChoiceGroup15() });//GEN-BEGIN:|28-getter|1|28-postInit
            form1.addCommand(getOkCommand1());
            form1.addCommand(getExitCommand1());
            form1.setCommandListener(this);//GEN-END:|28-getter|1|28-postInit
            // write post-init user code here
        }//GEN-BEGIN:|28-getter|2|
        return form1;
    }
    //</editor-fold>//GEN-END:|28-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup1 ">//GEN-BEGIN:|29-getter|0|29-preInit
    /**
     * Returns an initiliazed instance of choiceGroup1 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup1() {
        if (choiceGroup1 == null) {//GEN-END:|29-getter|0|29-preInit
            // write pre-init user code here
            choiceGroup1 = new ChoiceGroup("1.Computers that operate in essentially the same way are said to be", Choice.EXCLUSIVE);//GEN-BEGIN:|29-getter|1|29-postInit
            choiceGroup1.append("A. compound", null);
            choiceGroup1.append("B. compatible", null);
            choiceGroup1.append("C. user-friendly", null);
            choiceGroup1.append("D. integrated", null);
            choiceGroup1.setFitPolicy(Choice.TEXT_WRAP_DEFAULT);
            choiceGroup1.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|29-getter|1|29-postInit
            // write post-init user code here
        }//GEN-BEGIN:|29-getter|2|
        return choiceGroup1;
    }
    //</editor-fold>//GEN-END:|29-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand1 ">//GEN-BEGIN:|34-getter|0|34-preInit
    /**
     * Returns an initiliazed instance of okCommand1 component.
     * @return the initialized component instance
     */
    public Command getOkCommand1() {
        if (okCommand1 == null) {//GEN-END:|34-getter|0|34-preInit
            // write pre-init user code here
            okCommand1 = new Command("Ok", Command.OK, 0);//GEN-LINE:|34-getter|1|34-postInit
            // write post-init user code here
        }//GEN-BEGIN:|34-getter|2|
        return okCommand1;
    }
    //</editor-fold>//GEN-END:|34-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: exitCommand1 ">//GEN-BEGIN:|36-getter|0|36-preInit
    /**
     * Returns an initiliazed instance of exitCommand1 component.
     * @return the initialized component instance
     */
    public Command getExitCommand1() {
        if (exitCommand1 == null) {//GEN-END:|36-getter|0|36-preInit
            // write pre-init user code here
            exitCommand1 = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|36-getter|1|36-postInit
            // write post-init user code here
        }//GEN-BEGIN:|36-getter|2|
        return exitCommand1;
    }
    //</editor-fold>//GEN-END:|36-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: stopCommand ">//GEN-BEGIN:|51-getter|0|51-preInit
    /**
     * Returns an initiliazed instance of stopCommand component.
     * @return the initialized component instance
     */
    public Command getStopCommand() {
        if (stopCommand == null) {//GEN-END:|51-getter|0|51-preInit
            // write pre-init user code here
            stopCommand = new Command("Stop", Command.STOP, 0);//GEN-LINE:|51-getter|1|51-postInit
            // write post-init user code here
        }//GEN-BEGIN:|51-getter|2|
        return stopCommand;
    }
    //</editor-fold>//GEN-END:|51-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup2 ">//GEN-BEGIN:|38-getter|0|38-preInit
    /**
     * Returns an initiliazed instance of choiceGroup2 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup2() {
        if (choiceGroup2 == null) {//GEN-END:|38-getter|0|38-preInit
            // write pre-init user code here
            choiceGroup2 = new ChoiceGroup("2. A computer processes data in a device called the\t ", Choice.EXCLUSIVE);//GEN-BEGIN:|38-getter|1|38-postInit
            choiceGroup2.append("A.server", null);
            choiceGroup2.append("B.URL", null);
            choiceGroup2.append("C. device driver", null);
            choiceGroup2.append("D.CPU", null);
            choiceGroup2.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|38-getter|1|38-postInit
            // write post-init user code here
        }//GEN-BEGIN:|38-getter|2|
        return choiceGroup2;
    }
    //</editor-fold>//GEN-END:|38-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup3 ">//GEN-BEGIN:|43-getter|0|43-preInit
    /**
     * Returns an initiliazed instance of choiceGroup3 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup3() {
        if (choiceGroup3 == null) {//GEN-END:|43-getter|0|43-preInit
            // write pre-init user code here
            choiceGroup3 = new ChoiceGroup("3.What is the binary equivalent of the decimal number 123?  ", Choice.EXCLUSIVE);//GEN-BEGIN:|43-getter|1|43-postInit
            choiceGroup3.append("A.1111011 ", null);
            choiceGroup3.append("B.1101110", null);
            choiceGroup3.append("C.1100101", null);
            choiceGroup3.append("D.1010101", null);
            choiceGroup3.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|43-getter|1|43-postInit
            // write post-init user code here
        }//GEN-BEGIN:|43-getter|2|
        return choiceGroup3;
    }
    //</editor-fold>//GEN-END:|43-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup4 ">//GEN-BEGIN:|53-getter|0|53-preInit
    /**
     * Returns an initiliazed instance of choiceGroup4 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup4() {
        if (choiceGroup4 == null) {//GEN-END:|53-getter|0|53-preInit
            // write pre-init user code here
            choiceGroup4 = new ChoiceGroup("4.How many bits are required to store any given number in the range 0 to 255?\t", Choice.EXCLUSIVE);//GEN-BEGIN:|53-getter|1|53-postInit
            choiceGroup4.append("A.16", null);
            choiceGroup4.append("B.4", null);
            choiceGroup4.append("C.32", null);
            choiceGroup4.append("D.8", null);
            choiceGroup4.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|53-getter|1|53-postInit
            // write post-init user code here
        }//GEN-BEGIN:|53-getter|2|
        return choiceGroup4;
    }
    //</editor-fold>//GEN-END:|53-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup5 ">//GEN-BEGIN:|58-getter|0|58-preInit
    /**
     * Returns an initiliazed instance of choiceGroup5 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup5() {
        if (choiceGroup5 == null) {//GEN-END:|58-getter|0|58-preInit
            // write pre-init user code here
            choiceGroup5 = new ChoiceGroup("5.What is the decimal equivalent of the binary number 1101010?\t ", Choice.EXCLUSIVE);//GEN-BEGIN:|58-getter|1|58-postInit
            choiceGroup5.append("A.110", null);
            choiceGroup5.append("B.104", null);
            choiceGroup5.append("C.108", null);
            choiceGroup5.append("D.106", null);
            choiceGroup5.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|58-getter|1|58-postInit
            // write post-init user code here
        }//GEN-BEGIN:|58-getter|2|
        return choiceGroup5;
    }
    //</editor-fold>//GEN-END:|58-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup6 ">//GEN-BEGIN:|63-getter|0|63-preInit
    /**
     * Returns an initiliazed instance of choiceGroup6 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup6() {
        if (choiceGroup6 == null) {//GEN-END:|63-getter|0|63-preInit
            // write pre-init user code here
            choiceGroup6 = new ChoiceGroup("6.Of the following types of memory, which is least expensive?  ", Choice.EXCLUSIVE);//GEN-BEGIN:|63-getter|1|63-postInit
            choiceGroup6.append("A.Register", null);
            choiceGroup6.append("B.L1 Cache", null);
            choiceGroup6.append("C.DRAM", null);
            choiceGroup6.append("D.L2 Cache", null);
            choiceGroup6.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|63-getter|1|63-postInit
            // write post-init user code here
        }//GEN-BEGIN:|63-getter|2|
        return choiceGroup6;
    }
    //</editor-fold>//GEN-END:|63-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup7 ">//GEN-BEGIN:|68-getter|0|68-preInit
    /**
     * Returns an initiliazed instance of choiceGroup7 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup7() {
        if (choiceGroup7 == null) {//GEN-END:|68-getter|0|68-preInit
            // write pre-init user code here
            choiceGroup7 = new ChoiceGroup("7.Where is a computer\'s CPU located?\t", Choice.EXCLUSIVE);//GEN-BEGIN:|68-getter|1|68-postInit
            choiceGroup7.append("A.On a floppy disk drive", null);
            choiceGroup7.append("B.On an expansion card", null);
            choiceGroup7.append("C.On the motherboard", null);
            choiceGroup7.append("D.On a hard disk drive", null);
            choiceGroup7.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|68-getter|1|68-postInit
            // write post-init user code here
        }//GEN-BEGIN:|68-getter|2|
        return choiceGroup7;
    }
    //</editor-fold>//GEN-END:|68-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup8 ">//GEN-BEGIN:|73-getter|0|73-preInit
    /**
     * Returns an initiliazed instance of choiceGroup8 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup8() {
        if (choiceGroup8 == null) {//GEN-END:|73-getter|0|73-preInit
            // write pre-init user code here
            choiceGroup8 = new ChoiceGroup("8.Which bus transfers data between the CPU and the chipset?  ", Choice.EXCLUSIVE);//GEN-BEGIN:|73-getter|1|73-postInit
            choiceGroup8.append("A.PCI", null);
            choiceGroup8.append("B.Memory", null);
            choiceGroup8.append("C.Front side", null);
            choiceGroup8.append("D.AGP", null);
            choiceGroup8.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|73-getter|1|73-postInit
            // write post-init user code here
        }//GEN-BEGIN:|73-getter|2|
        return choiceGroup8;
    }
    //</editor-fold>//GEN-END:|73-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup9 ">//GEN-BEGIN:|78-getter|0|78-preInit
    /**
     * Returns an initiliazed instance of choiceGroup9 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup9() {
        if (choiceGroup9 == null) {//GEN-END:|78-getter|0|78-preInit
            // write pre-init user code here
            choiceGroup9 = new ChoiceGroup("9.\t A computer bus that transfers data twice per cycle is said to be double  ", Choice.EXCLUSIVE);//GEN-BEGIN:|78-getter|1|78-postInit
            choiceGroup9.append("A.channeled", null);
            choiceGroup9.append("B.wide", null);
            choiceGroup9.append("C.pumped", null);
            choiceGroup9.append("D.timed", null);
            choiceGroup9.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|78-getter|1|78-postInit
            // write post-init user code here
        }//GEN-BEGIN:|78-getter|2|
        return choiceGroup9;
    }
    //</editor-fold>//GEN-END:|78-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup10 ">//GEN-BEGIN:|83-getter|0|83-preInit
    /**
     * Returns an initiliazed instance of choiceGroup10 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup10() {
        if (choiceGroup10 == null) {//GEN-END:|83-getter|0|83-preInit
            // write pre-init user code here
            choiceGroup10 = new ChoiceGroup("10.A parallel port can be used to connect a computer to a\t", Choice.EXCLUSIVE);//GEN-BEGIN:|83-getter|1|83-postInit
            choiceGroup10.append("A.printer", null);
            choiceGroup10.append("B.mouse", null);
            choiceGroup10.append("C.keyboard", null);
            choiceGroup10.append("D.monitor", null);
            choiceGroup10.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|83-getter|1|83-postInit
            // write post-init user code here
        }//GEN-BEGIN:|83-getter|2|
        return choiceGroup10;
    }
    //</editor-fold>//GEN-END:|83-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup11 ">//GEN-BEGIN:|88-getter|0|88-preInit
    /**
     * Returns an initiliazed instance of choiceGroup11 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup11() {
        if (choiceGroup11 == null) {//GEN-END:|88-getter|0|88-preInit
            // write pre-init user code here
            choiceGroup11 = new ChoiceGroup("11. What is the general term used to describe the process of recoding data so that it requires fewer bytes of storage space?", Choice.EXCLUSIVE);//GEN-BEGIN:|88-getter|1|88-postInit
            choiceGroup11.append("A.Data compression", null);
            choiceGroup11.append("B.Rationing", null);
            choiceGroup11.append("C.Run length encoding", null);
            choiceGroup11.append("D.Encoding", null);
            choiceGroup11.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|88-getter|1|88-postInit
            // write post-init user code here
        }//GEN-BEGIN:|88-getter|2|
        return choiceGroup11;
    }
    //</editor-fold>//GEN-END:|88-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup12 ">//GEN-BEGIN:|93-getter|0|93-preInit
    /**
     * Returns an initiliazed instance of choiceGroup12 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup12() {
        if (choiceGroup12 == null) {//GEN-END:|93-getter|0|93-preInit
            // write pre-init user code here
            choiceGroup12 = new ChoiceGroup("12.Consider a sector in a disk that is only partially filled with data. The unused portion of the sector is known as  ", Choice.EXCLUSIVE);//GEN-BEGIN:|93-getter|1|93-postInit
            choiceGroup12.append("A. empty space", null);
            choiceGroup12.append("B. slack space", null);
            choiceGroup12.append("C.free space3", null);
            choiceGroup12.append("D.non-data space", null);
            choiceGroup12.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|93-getter|1|93-postInit
            // write post-init user code here
        }//GEN-BEGIN:|93-getter|2|
        return choiceGroup12;
    }
    //</editor-fold>//GEN-END:|93-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup13 ">//GEN-BEGIN:|98-getter|0|98-preInit
    /**
     * Returns an initiliazed instance of choiceGroup13 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup13() {
        if (choiceGroup13 == null) {//GEN-END:|98-getter|0|98-preInit
            // write pre-init user code here
            choiceGroup13 = new ChoiceGroup("13.An algorithm can be performed by following the", Choice.EXCLUSIVE);//GEN-BEGIN:|98-getter|1|98-postInit
            choiceGroup13.append("A.characters", null);
            choiceGroup13.append("B.instructions", null);
            choiceGroup13.append("C.standards", null);
            choiceGroup13.append("D.protocols", null);
            choiceGroup13.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|98-getter|1|98-postInit
            // write post-init user code here
        }//GEN-BEGIN:|98-getter|2|
        return choiceGroup13;
    }
    //</editor-fold>//GEN-END:|98-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup14 ">//GEN-BEGIN:|103-getter|0|103-preInit
    /**
     * Returns an initiliazed instance of choiceGroup14 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup14() {
        if (choiceGroup14 == null) {//GEN-END:|103-getter|0|103-preInit
            // write pre-init user code here
            choiceGroup14 = new ChoiceGroup("14.The bandwidth of a(n) _____ signal is usually measured in bits per second.", Choice.EXCLUSIVE);//GEN-BEGIN:|103-getter|1|103-postInit
            choiceGroup14.append("A.analog", null);
            choiceGroup14.append("B.satellite", null);
            choiceGroup14.append("C.digital", null);
            choiceGroup14.append("D.video", null);
            choiceGroup14.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|103-getter|1|103-postInit
            // write post-init user code here
        }//GEN-BEGIN:|103-getter|2|
        return choiceGroup14;
    }
    //</editor-fold>//GEN-END:|103-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup15 ">//GEN-BEGIN:|108-getter|0|108-preInit
    /**
     * Returns an initiliazed instance of choiceGroup15 component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup15() {
        if (choiceGroup15 == null) {//GEN-END:|108-getter|0|108-preInit
            // write pre-init user code here
            choiceGroup15 = new ChoiceGroup("15.Encryption is used to\t ", Choice.EXCLUSIVE);//GEN-BEGIN:|108-getter|1|108-postInit
            choiceGroup15.append("A.save storage space", null);
            choiceGroup15.append("B.archive system files", null);
            choiceGroup15.append("C.protect privacy by encoding data", null);
            choiceGroup15.append("D.store data files in a vault", null);
            choiceGroup15.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|108-getter|1|108-postInit
            // write post-init user code here
        }//GEN-BEGIN:|108-getter|2|
        return choiceGroup15;
    }
    //</editor-fold>//GEN-END:|108-getter|2|


    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cancelCommand ">//GEN-BEGIN:|117-getter|0|117-preInit
    /**
     * Returns an initiliazed instance of cancelCommand component.
     * @return the initialized component instance
     */
    public Command getCancelCommand() {
        if (cancelCommand == null) {//GEN-END:|117-getter|0|117-preInit
            // write pre-init user code here
            cancelCommand = new Command("Cancel", Command.CANCEL, 0);//GEN-LINE:|117-getter|1|117-postInit
            // write post-init user code here
        }//GEN-BEGIN:|117-getter|2|
        return cancelCommand;
    }
    //</editor-fold>//GEN-END:|117-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: image1 ">//GEN-BEGIN:|123-getter|0|123-preInit
    /**
     * Returns an initiliazed instance of image1 component.
     * @return the initialized component instance
     */
    public Image getImage1() {
        if (image1 == null) {//GEN-END:|123-getter|0|123-preInit
            // write pre-init user code here
            try {//GEN-BEGIN:|123-getter|1|123-@java.io.IOException
                image1 = Image.createImage("/millionare.PNG");
            } catch (java.io.IOException e) {//GEN-END:|123-getter|1|123-@java.io.IOException
                e.printStackTrace();
            }//GEN-LINE:|123-getter|2|123-postInit
            // write post-init user code here
        }//GEN-BEGIN:|123-getter|3|
        return image1;
    }
    //</editor-fold>//GEN-END:|123-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: helpCommand ">//GEN-BEGIN:|140-getter|0|140-preInit
    /**
     * Returns an initiliazed instance of helpCommand component.
     * @return the initialized component instance
     */
    public Command getHelpCommand() {
        if (helpCommand == null) {//GEN-END:|140-getter|0|140-preInit
            // write pre-init user code here
            helpCommand = new Command("Help", Command.HELP, 0);//GEN-LINE:|140-getter|1|140-postInit
            // write post-init user code here
        }//GEN-BEGIN:|140-getter|2|
        return helpCommand;
    }
    //</editor-fold>//GEN-END:|140-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Items ">//GEN-BEGIN:|17-itemCommandAction|0|17-preItemCommandAction
    /**
     * Called by a system to indicated that a command has been invoked on a particular item.
     * @param command the Command that was invoked
     * @param displayable the Item where the command was invoked
     */
    public void commandAction(Command command, Item item) {//GEN-END:|17-itemCommandAction|0|17-preItemCommandAction
        // write pre-action user code here
        if (item == choiceGroup) {//GEN-BEGIN:|17-itemCommandAction|1|113-preAction
            if (command == okCommand1) {//GEN-END:|17-itemCommandAction|1|113-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm1());//GEN-LINE:|17-itemCommandAction|2|113-postAction
                // write post-action user code here
            }//GEN-BEGIN:|17-itemCommandAction|3|133-preAction
        } else if (item == stringItem1) {
            if (command == okCommand1) {//GEN-END:|17-itemCommandAction|3|133-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm1());//GEN-LINE:|17-itemCommandAction|4|133-postAction
                // write post-action user code here
            }//GEN-BEGIN:|17-itemCommandAction|5|136-preAction
        } else if (item == stringItem2) {
            if (command == okCommand1) {//GEN-END:|17-itemCommandAction|5|136-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm2());//GEN-LINE:|17-itemCommandAction|6|136-postAction
                // write post-action user code here
            }//GEN-BEGIN:|17-itemCommandAction|7|138-preAction
        } else if (item == stringItem3) {
            if (command == okCommand1) {//GEN-END:|17-itemCommandAction|7|138-preAction
                // write pre-action user code here
                switchDisplayable(null, getForm2());//GEN-LINE:|17-itemCommandAction|8|138-postAction
                // write post-action user code here
            }//GEN-BEGIN:|17-itemCommandAction|9|17-postItemCommandAction
        }//GEN-END:|17-itemCommandAction|9|17-postItemCommandAction
        // write post-action user code here
    }//GEN-BEGIN:|17-itemCommandAction|10|
    //</editor-fold>//GEN-END:|17-itemCommandAction|10|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: form ">//GEN-BEGIN:|14-getter|0|14-preInit
    /**
     * Returns an initiliazed instance of form component.
     * @return the initialized component instance
     */
    public Form getForm() {
        if (form == null) {//GEN-END:|14-getter|0|14-preInit
            // write pre-init user code here
            form = new Form("Welcome", new Item[] { getStringItem(), getChoiceGroup(), getStringItem1(), getStringItem3(), getStringItem2(), getImageItem() });//GEN-BEGIN:|14-getter|1|14-postInit
            form.addCommand(getExitCommand1());
            form.setCommandListener(this);//GEN-END:|14-getter|1|14-postInit
            // write post-init user code here
        }//GEN-BEGIN:|14-getter|2|
        return form;
    }
    //</editor-fold>//GEN-END:|14-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: choiceGroup ">//GEN-BEGIN:|22-getter|0|22-preInit
    /**
     * Returns an initiliazed instance of choiceGroup component.
     * @return the initialized component instance
     */
    public ChoiceGroup getChoiceGroup() {
        if (choiceGroup == null) {//GEN-END:|22-getter|0|22-preInit
            // write pre-init user code here
            choiceGroup = new ChoiceGroup("Menu", Choice.EXCLUSIVE);//GEN-BEGIN:|22-getter|1|22-postInit
            choiceGroup.addCommand(getOkCommand1());
            choiceGroup.setItemCommandListener(this);
            choiceGroup.setLayout(ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER);
            choiceGroup.setFitPolicy(Choice.TEXT_WRAP_DEFAULT);
            choiceGroup.setSelectedFlags(new boolean[] {  });
            choiceGroup.setPreferredSize(-1, -1);//GEN-END:|22-getter|1|22-postInit
            // write post-init user code here
        }//GEN-BEGIN:|22-getter|2|
        return choiceGroup;
    }
    //</editor-fold>//GEN-END:|22-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem1 ">//GEN-BEGIN:|132-getter|0|132-preInit
    /**
     * Returns an initiliazed instance of stringItem1 component.
     * @return the initialized component instance
     */
    public StringItem getStringItem1() {
        if (stringItem1 == null) {//GEN-END:|132-getter|0|132-preInit
            // write pre-init user code here
            stringItem1 = new StringItem("", "New Game", Item.BUTTON);//GEN-BEGIN:|132-getter|1|132-postInit
            stringItem1.addCommand(getOkCommand1());
            stringItem1.setItemCommandListener(this);
            stringItem1.setDefaultCommand(getOkCommand1());
            stringItem1.setLayout(ImageItem.LAYOUT_DEFAULT | Item.LAYOUT_VEXPAND);//GEN-END:|132-getter|1|132-postInit
            // write post-init user code here
        }//GEN-BEGIN:|132-getter|2|
        return stringItem1;
    }
    //</editor-fold>//GEN-END:|132-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem ">//GEN-BEGIN:|122-getter|0|122-preInit
    /**
     * Returns an initiliazed instance of imageItem component.
     * @return the initialized component instance
     */
    public ImageItem getImageItem() {
        if (imageItem == null) {//GEN-END:|122-getter|0|122-preInit
            // write pre-init user code here
            imageItem = new ImageItem("", getImage1(), ImageItem.LAYOUT_DEFAULT, "<Missing Image>", Item.PLAIN);//GEN-BEGIN:|122-getter|1|122-postInit
            imageItem.setPreferredSize(-1, -1);//GEN-END:|122-getter|1|122-postInit
            // write post-init user code here
        }//GEN-BEGIN:|122-getter|2|
        return imageItem;
    }
    //</editor-fold>//GEN-END:|122-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem3 ">//GEN-BEGIN:|137-getter|0|137-preInit
    /**
     * Returns an initiliazed instance of stringItem3 component.
     * @return the initialized component instance
     */
    public StringItem getStringItem3() {
        if (stringItem3 == null) {//GEN-END:|137-getter|0|137-preInit
            // write pre-init user code here
            stringItem3 = new StringItem("", "Help", Item.BUTTON);//GEN-BEGIN:|137-getter|1|137-postInit
            stringItem3.addCommand(getOkCommand1());
            stringItem3.setItemCommandListener(this);
            stringItem3.setDefaultCommand(getOkCommand1());//GEN-END:|137-getter|1|137-postInit
            // write post-init user code here
        }//GEN-BEGIN:|137-getter|2|
        return stringItem3;
    }
    //</editor-fold>//GEN-END:|137-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem2 ">//GEN-BEGIN:|135-getter|0|135-preInit
    /**
     * Returns an initiliazed instance of stringItem2 component.
     * @return the initialized component instance
     */
    public StringItem getStringItem2() {
        if (stringItem2 == null) {//GEN-END:|135-getter|0|135-preInit
            // write pre-init user code here
            stringItem2 = new StringItem("", "Quit", Item.BUTTON);//GEN-BEGIN:|135-getter|1|135-postInit
            stringItem2.addCommand(getOkCommand1());
            stringItem2.setItemCommandListener(this);
            stringItem2.setDefaultCommand(getOkCommand1());//GEN-END:|135-getter|1|135-postInit
            // write post-init user code here
        }//GEN-BEGIN:|135-getter|2|
        return stringItem2;
    }
    //</editor-fold>//GEN-END:|135-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem ">//GEN-BEGIN:|16-getter|0|16-preInit
    /**
     * Returns an initiliazed instance of stringItem component.
     * @return the initialized component instance
     */
    public StringItem getStringItem() {
        if (stringItem == null) {//GEN-END:|16-getter|0|16-preInit
            // write pre-init user code here
            stringItem = new StringItem("", "Who wants to be a Millioneire? ");//GEN-BEGIN:|16-getter|1|16-postInit
            stringItem.setItemCommandListener(this);
            stringItem.setLayout(ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER);//GEN-END:|16-getter|1|16-postInit
            // write post-init user code here
        }//GEN-BEGIN:|16-getter|2|
        return stringItem;
    }
    //</editor-fold>//GEN-END:|16-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: form2 ">//GEN-BEGIN:|142-getter|0|142-preInit
    /**
     * Returns an initiliazed instance of form2 component.
     * @return the initialized component instance
     */
    public Form getForm2() {
        if (form2 == null) {//GEN-END:|142-getter|0|142-preInit
            // write pre-init user code here
            form2 = new Form("form2", new Item[] { getStringItem4() });//GEN-BEGIN:|142-getter|1|142-postInit
            form2.addCommand(getExitCommand1());
            form2.setCommandListener(this);//GEN-END:|142-getter|1|142-postInit
            // write post-init user code here
        }//GEN-BEGIN:|142-getter|2|
        return form2;
    }
    //</editor-fold>//GEN-END:|142-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem4 ">//GEN-BEGIN:|144-getter|0|144-preInit
    /**
     * Returns an initiliazed instance of stringItem4 component.
     * @return the initialized component instance
     */
    public StringItem getStringItem4() {
        if (stringItem4 == null) {//GEN-END:|144-getter|0|144-preInit
            // write pre-init user code here
            stringItem4 = new StringItem("In order to earn 1 million rubles, must correctly answer 15 questions from different fields of knowledge. Each question has 4 possible answers, of which only one is correct. Each question has a specific value.\n\nThe player offers three tips:\n\n    * \"50:50\" - a computer eliminates two incorrect answers\n    * \"Call a Friend\" - within 30 seconds, the player can consult with one of the five friends, declared in advance\n    * \"Help Room\" - Everyone in the studio audience votes for the right, in his view, the answer, and the player statistics vote", "");//GEN-BEGIN:|144-getter|1|144-postInit
            stringItem4.setLayout(ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER);//GEN-END:|144-getter|1|144-postInit
            // write post-init user code here
        }//GEN-BEGIN:|144-getter|2|
        return stringItem4;
    }
    //</editor-fold>//GEN-END:|144-getter|2|

    /**
     * Returns a display instance.
     * @return the display instance.
     */
    public Display getDisplay () {
        return Display.getDisplay(this);
    }

    /**
     * Exits MIDlet.
     */
    public void exitMIDlet() {
        switchDisplayable (null, null);
        destroyApp(true);
        notifyDestroyed();
    }

    /**
     * Called when MIDlet is started.
     * Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.
     */
    public void startApp() {

        if (midletPaused) {
            resumeMIDlet ();
        } else {
            initialize ();
            startMIDlet ();
        }
        midletPaused = false;
    }

    /**
     * Called when MIDlet is paused.
     */
    public void pauseApp() {
        midletPaused = true;
    }

    /**
     * Called to signal the MIDlet to terminate.
     * @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released.
     */
    public void destroyApp(boolean unconditional) {
    }

    public void OkAlert(){
        soundAlert.setType(AlertType.WARNING);
        soundAlert.setString("You are right!");
        switchDisplayable(soundAlert, form);
    }

    public void ErrorAlert(){
        soundAlert.setType(AlertType.ERROR);
        soundAlert.setString("You are not right!");
        switchDisplayable(soundAlert, form);
    }


}
